package com.zt.csp.shorturl.config;

import com.zt.csp.shorturl.interceptor.TempInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 拦截器配置
 * Created by zt on 2018/4/25 0025
 */
@Configuration
public class InterceptorConfig extends WebMvcConfigurerAdapter {

    @Autowired
    private TempInterceptor tempInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(tempInterceptor).addPathPatterns("/api/hcreate", "/api/list", "/api/delete", "/api/log");
    }
}
